import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class ThemeService {
  private theme:BehaviorSubject<String>;
  constructor() { 
    this.theme=new BehaviorSubject("default-theme");
  }

  setActiveTheme(val){
    //新值
     this.theme.next(val);
  }

  getActiveTheme(){
    //观察
      return this.theme.asObservable();
  }
}
